org.eclipse.jdt.core
Interface IField
- All Superinterfaces:
- IAdaptable, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference
- public interface IField
- extends IMember
Represents a field declared in a type.
This interface is not intended to be implemented by clients.
Fields inherited from interface org.eclipse.jdt.core.IJavaElement |
CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE |
Methods inherited from interface org.eclipse.jdt.core.IJavaElement |
exists, getAncestor, getCorrespondingResource, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getUnderlyingResource, isReadOnly, isStructureKnown |
getConstant
public Object getConstant()
throws JavaModelException
- Returns the constant value associated with this field
or
null
if this field has none. The field needs to be static and final to have
a constant value.
Returns an instance of the wrapper type corresponding to the the type of the field.
field type |
wrapper type |
int
|
java.lang.Integer
|
byte
|
java.lang.Byte
|
boolean
|
java.lang.Boolean
|
char
|
java.lang.Character
|
double
|
java.lang.Double
|
float
|
java.lang.Float
|
long
|
java.lang.Long
|
short
|
java.lang.Short
|
java.lang.String
|
java.lang.String
|
- Returns:
- the constant value associated with this field or
null
if this field has none.
- Throws:
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource
getElementName
public String getElementName()
- Returns the simple name of this field.
- Specified by:
getElementName
in interface IJavaElement
- Returns:
- the simple name of this field.
getTypeSignature
public String getTypeSignature()
throws JavaModelException
- Returns the type signature of this field.
- Returns:
- the type signature of this field.
- Throws:
JavaModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource- See Also:
Signature
Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.